public class t55 {
    public static void main(String[] args) {
        int nums[] = {2,3,1,1,4};//青蛙跳格子
        boolean dp[] = new boolean[nums.length];
        dp[0] = true;
        for(int i = 1; i<=dp.length-1; i++){
            dp[i] = false;
            for(int j = 0; j<i; j++){
                if(dp[j] && i-j<=nums[j]){
                    dp[i] = true;
                    break;
                }
            }
        }
       //return dp[nums.length-1];
        //System.out.println(dp[nums.length]);


    }
}



































 /*boolean dp [] = new boolean[nums.length];
        dp[0] = true;
        for(int i =1; i<dp.length; i++){
            dp[i] = false;
            for(int j = 0; j<i; j++){
                if(dp[j]&&i-j<=nums[j]){
                    dp[i] = true;
                    break;
                }
            }
        }
        System.out.println(dp[nums.length-1])*/;